Public Class frmGnrtScript

  Dim clsobjGenClas As clsGenClas
  Private Shared mObjClsFrmGnrtScript As frmGnrtScript


  Private Sub New()

    ' This call is required by the Windows Form Designer.
    InitializeComponent()

    ' Add any initialization after the InitializeComponent() call.

  End Sub



  Public Shared Function mPrGetInstance() As frmGnrtScript
    If mObjClsFrmGnrtScript Is Nothing Then
      mObjClsFrmGnrtScript = New frmGnrtScript
    End If
    Return mObjClsFrmGnrtScript
  End Function



  Private Sub frmGnrtScript_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    cboDataBase.SelectedIndex = 0

  End Sub





  Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClose.Click
    'Disconnect database
    DBDisconnect()

    Me.Dispose()
  End Sub





  Private Sub cmdGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGenerate.Click

    Dim lStrClntSrvrIdentifier As String = ""
    Dim lStrArrClntSrvrIdentifier As String()

    lStrClntSrvrIdentifier = Trim(txtTableName.Text)

    lStrArrClntSrvrIdentifier = lStrClntSrvrIdentifier.Split("_")

    clsobjGenClas = New clsGenClas

    If Trim(txtTableName.Text) = "" Then
      MessageBox.Show("Table Name cannot be blank", gCONST_MSG_HEADER)
      txtTableName.Focus()
      Exit Sub
    End If
    If Trim(txtMainClassName.Text) = "" Then
      MessageBox.Show("Main Class Name cannot be blank", gCONST_MSG_HEADER)
      txtMainClassName.Focus()
      Exit Sub
    End If

    'mPrRefreshConn()

    'If clsobjGenClas.mFnGenerateClass = False Then
    '  MessageBox.Show("No file generated", gCONST_MSG_HEADER)
    '  Exit Sub
    'Else
    '  MessageBox.Show("Main File generated at C:\Table Classes", gCONST_MSG_HEADER)
    'End If

    'If chkHelperClassRequired.Checked = True Then
    '  If clsobjGenClas.mfnGenerateHelperClass = False Then
    '    MessageBox.Show("No file generated", gCONST_MSG_HEADER)
    '    Exit Sub
    '  Else
    '    MessageBox.Show("Helper File generated at C:\Table Classes", gCONST_MSG_HEADER)
    '  End If
    'End If


    'If lStrArrClntSrvrIdentifier(0) = "DWS" Then

    'If clsobjGenClas.mFnGenerateSQLCEScript(Me.txtNewTableName.Text _
    '                                      , clsobjGenClas.mFnGnrtClassName _
    '                                        (Me.txtNewTableName.Text)) = False Then
    '  MessageBox.Show("No file generated", gCONST_MSG_HEADER)
    '  Exit Sub
    'Else
    '  MessageBox.Show("SQLCE Script Generated at C:\SQLCE Script", gCONST_MSG_HEADER)
    'End If

    ''Else

    'If clsobjGenClas.mFnGnrtOracleScript = False Then
    '  MessageBox.Show("No file generated", gCONST_MSG_HEADER)
    '  Exit Sub
    'Else
    '  MessageBox.Show("Oracle Script Generated at C:\ORACLE Script", gCONST_MSG_HEADER)
    'End If

    ''End If

  End Sub

End Class
